<?php

namespace App\Http\Controllers\Api\V1;

use League\Fractal\TransformerAbstract;

class TransformerController extends TransformerAbstract
{
    //
    public function transform($lesson)
    {
        /******隐藏数据库字段*****/
        return [
            'goods_id' => $lesson['id'],
            'goods_sn' => $lesson['sn'],
            'goods_name' => $lesson['name'],
            'goods_thumb' => env('APP_DOMIN', '').$lesson['thumb'],
            'goods_price' => $lesson['price'],
            'goods_stock' => $lesson['stock'],
            'goods_on_sale' => $lesson['on_sale'],
            'goods_is_recommented' => $lesson['is_recommented'],
            'goods_saled_num' => $lesson['saled_num'],
        ];
    }
}
